<?php
    @header("Content-Type:text/html;charset=utf-8");  // 兼容低版本php
    

    // 1.链接mysql
    const host = "b-qblhnont0g5tze.bch.rds.bj.baidubce.com";
    const user = "b_qblhnont0g5tze";
    const pwd = "12345678";
    const dbName = "b_qblhnont0g5tze";

    $conn = mysqli_connect(host, user,pwd,dbName);
    // echo json_encode ($conn);
    // print_r($conn);

    if(!$conn){
      exit('数据库链接失败!!!');
    }

    // 转码设置  => 可以手写 但是没有必要 (可以不写 但是不能写错)
    mysqli_query($conn,"set names utf8");
    mysqli_query($conn,"set character set utf-8");


?>